package de.mhus.lib.mandala.attributes;

import de.mhus.lib.mandala.Attribute;
import de.mhus.lib.mandala.Response;
import de.mhus.lib.mandala.bind.DataRow;

public class ArrayAttribute extends Attribute {

	@Override
	protected void doRender(Response out) {
		out.print("ko.observableArray()");
	}

	public void renderRemoveAll(Response out) {
		renderElementName(out);
		out.println(".removeAll();");
	}

	public void renderAppendData(Response out,DataRow row) {
		renderElementName(out);
		out.println(".push(" + row.toJSONString() + ");");
	}

}
